package org.gruposp2p.aula.gwt.client.content.student;

import org.gruposp2p.aula.gwt.client.AulaApplication;
import org.gruposp2p.aula.gwt.client.AulaConstants;
import org.gruposp2p.aula.gwt.client.model.Student;
import org.gruposp2p.aula.gwt.client.representation.StudentsRepresentation;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.i18n.client.Constants;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class StudentDataPanel extends VerticalPanel {

	private AulaApplication aulaApplication;
	private AulaConstants constants;
	private TextBox nameTextBox;
	private TextArea descriptionTextArea;
	
	public static interface CwConstants extends Constants {
		String StudentNameLabel();
		String StudentSurnameLabel();
	}
	
	public StudentDataPanel (AulaApplication aulaApplication) {
		this.aulaApplication = aulaApplication;
		this.constants = aulaApplication.getConstants();
		setTitle(constants.NewStudentDialogBoxCaption()); 

		add(new Label(constants.NewStudentDialogBoxNameLabel()));
	    nameTextBox = new TextBox ();
	    add(nameTextBox);

	    add(new Label(constants.NewStudentDialogBoxDescriptionLabel()));
	    descriptionTextArea = new TextArea();
	    descriptionTextArea.setHeight("120");
	    
	    add(descriptionTextArea);

	    Button acceptButton = new Button(constants.AcceptButtonCaption(),
	    		new ClickHandler() {
		        	public void onClick(ClickEvent event) {		       	  
		        	}
		        });

	    HorizontalPanel buttonPanel = new HorizontalPanel();
	    buttonPanel.setSpacing(5);
	    buttonPanel.setWidth("210");
	    buttonPanel.add(acceptButton);
	    buttonPanel.setCellHorizontalAlignment(acceptButton, HorizontalPanel.ALIGN_RIGHT);
	    add(buttonPanel);

	    setStylePrimaryName("tabbedForm");
	    
	    //To solve Firefox strange effect
	    nameTextBox.setFocus(true);		
	}
	
	private void showPanel (Student student) { }
	
}